﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace WebService
{
    /// <summary>
    /// Summary description for Service1
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class Service1 : System.Web.Services.WebService
    {

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }

        //Các hàm lấy từ class DataProvider.cs
        #region
        [WebMethod]
        public bool CheckConnect()
        {
            return DataProvider.Checkconnect();
        }

        //
        #endregion

        //Các hàm lấy từ NhanVienDAO
        #region
        [WebMethod]
        public NhanVienDTO[] GetDanhSachNhanVien()
        {
            NhanVienDAO nvDAO = new NhanVienDAO();
            return nvDAO.GetDanhSachNhanVien();
        }
         #endregion
        //Các hàm lấy từ KhachHangDAO
        #region
        [WebMethod]
        public KhachHang[] LayDSKH(String MaTour)
        {
            NhanVienDAO nvDAO = new NhanVienDAO();
            return nvDAO.layDSKH(MaTour);
        }
        [WebMethod]
        public Tour[] TimTour(string toor)
        {
            KhachHangDAO KH = new KhachHangDAO();
            return KH.TimTour(toor);
        }
        [WebMethod]
        public Tour XemTour(String MaTour)
        {
            Tour T = new Tour();
            T.LayThongTin(MaTour);
            return T;
        }
        [WebMethod]
        public Tour[] XemLS(String MaKH)
        {
            KhachHangDAO KH = new KhachHangDAO();
            return KH.XemLS(MaKH);
        }
        [WebMethod]
        public bool DatTour(String MaKH, String MaTour)
        {
            KhachHangDAO KH = new KhachHangDAO();
            return KH.DatTour(MaTour, MaKH);
        }
        [WebMethod]
        public bool AMuaTour(String MaTour, int SoNguoi, String[] ListNguoiDi)
        {
            KhachHangDAO KH = new KhachHangDAO();
            return KH.AMuaTour(MaTour, SoNguoi, ListNguoiDi);
        }
        #endregion

    }
}